#include "EEPROM.h"
#include "bsp_flash.h"
#include "Main_constant.h"

void    bspFlashInit(){
    EEPROM.begin(64);
}

void bspFlashWrite(int addr,uint8_t val){
       EEPROM.write(addr, val);
       EEPROM.commit();
}

uint8_t bspFlashRead(int addr){
   return  EEPROM.read(addr);
}

void saveConfigToFlash(){
    bspFlashWrite(0, g_config.dda_uart_id);
}